﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Obra.PowerShell.SmugMug
{
    /// <summary>
    /// Representation of an item, such as an album or image.
    /// </summary>
    internal interface ICmdletService
    {
        /// <summary>
        /// Get the name of the item -- think Path.GetFileName().
        /// </summary>
        string Name
        {
            get;
        }

        /// <summary>
        /// Fully qualified path of the item.
        /// </summary>
        string Path
        {
            get;
        }

        /// <summary>
        /// Command line options supplied with this command.
        /// </summary>
        DynamicParametersItem Options
        {
            get;
            set;
        }

        /// <summary>
        /// Clear this item.
        /// </summary>
        void Clear();

        /// <summary>
        /// Copy this item to the specified path.
        /// </summary>
        /// <param name="path">
        /// Target path of the copy.
        /// </param>
        void Copy(string path);

        /// <summary>
        /// True if this item exists.
        /// </summary>
        bool Exists();

        /// <summary>
        /// Get the item represented by this service.
        /// </summary>
        object Get();

        /// <summary>
        /// Get the URI of th is item.
        /// </summary>
        Uri GetUri();

        /// <summary>
        /// The children owned by this item, such as the images in an album.
        /// </summary>
        DirectoryChild[] GetChildren();

        /// <summary>
        /// True if this item is a container, such as an album.
        /// </summary>
        bool IsContainer();

        /// <summary>
        /// Move this item to the specified path.
        /// </summary>
        /// <param name="path">
        /// Target path of the move.
        /// </param>
        void Move(string path);

        /// <summary>
        /// Create a new item from the specified value.
        /// </summary>
        /// <param name="name">
        /// Name of the item.
        /// </param>
        /// <param name="value">
        /// Data of the item to create.
        /// </param>
        void New(string name, object value);

        /// <summary>
        /// Remove the item.
        /// </summary>
        void Remove();

        /// <summary>
        /// Rename the item.
        /// </summary>
        /// <param name="name">
        /// New name of the item.
        /// </param>
        void Rename(string name);

        /// <summary>
        /// Set the contents of the item.
        /// </summary>
        /// <param name="value">
        /// Data to set on the item.
        /// </param>
        void Set(object value);
    }
}
